3.219 \(\int (B \cos (c+d x)+C \cos ^2(c+d x)) \, dx\)

Optimal. Leaf size=38 \[ \frac{B \sin (c+d x)}{d}+\frac{C \sin (c+d x) \cos (c+d x)}{2 d}+\frac{C x}{2} \]

[Out]

(C*x)/2 + (B*Sin[c + d*x])/d + (C*Cos[c + d*x]*Sin[c + d*x])/(2*d)

________________________________________________________________________________________

Rubi [A]  time = 0.023467, antiderivative size = 38, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.158, Rules used = {2637, 2635, 8} \[ \frac{B \sin (c+d x)}{d}+\frac{C \sin (c+d x) \cos (c+d x)}{2 d}+\frac{C x}{2} \]

Antiderivative was successfully verified.

[In]

Int[B*Cos[c + d*x] + C*Cos[c + d*x]^2,x]

[Out]

(C*x)/2 + (B*Sin[c + d*x])/d + (C*Cos[c + d*x]*Sin[c + d*x])/(2*d)

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx &=B \int \cos (c+d x) \, dx+C \int \cos ^2(c+d x) \, dx\\ &=\frac{B \sin (c+d x)}{d}+\frac{C \cos (c+d x) \sin (c+d x)}{2 d}+\frac{1}{2} C \int 1 \, dx\\ &=\frac{C x}{2}+\frac{B \sin (c+d x)}{d}+\frac{C \cos (c+d x) \sin (c+d x)}{2 d}\\ \end{align*}

Mathematica [A]  time = 0.0614901, size = 35, normalized size = 0.92 \[ \frac{4 B \sin (c+d x)+C (2 (c+d x)+\sin (2 (c+d x)))}{4 d} \]

Antiderivative was successfully verified.

[In]

Integrate[B*Cos[c + d*x] + C*Cos[c + d*x]^2,x]

[Out]

(4*B*Sin[c + d*x] + C*(2*(c + d*x) + Sin[2*(c + d*x)]))/(4*d)

________________________________________________________________________________________

Maple [A]  time = 0.014, size = 40, normalized size = 1.1 \begin{align*}{\frac{B\sin \left ( dx+c \right ) }{d}}+{\frac{C}{d} \left ({\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2}}+{\frac{dx}{2}}+{\frac{c}{2}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(B*cos(d*x+c)+C*cos(d*x+c)^2,x)

[Out]

B*sin(d*x+c)/d+C/d*(1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c)

________________________________________________________________________________________

Maxima [A]  time = 1.26855, size = 47, normalized size = 1.24 \begin{align*} \frac{{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C}{4 \, d} + \frac{B \sin \left (d x + c\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(B*cos(d*x+c)+C*cos(d*x+c)^2,x, algorithm="maxima")

[Out]

1/4*(2*d*x + 2*c + sin(2*d*x + 2*c))*C/d + B*sin(d*x + c)/d

________________________________________________________________________________________

Fricas [A]  time = 1.5711, size = 72, normalized size = 1.89 \begin{align*} \frac{C d x +{\left (C \cos \left (d x + c\right ) + 2 \, B\right )} \sin \left (d x + c\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(B*cos(d*x+c)+C*cos(d*x+c)^2,x, algorithm="fricas")

[Out]

1/2*(C*d*x + (C*cos(d*x + c) + 2*B)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [A]  time = 0.352142, size = 63, normalized size = 1.66 \begin{align*} B \left (\begin{cases} \frac{\sin{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \cos{\left (c \right )} & \text{otherwise} \end{cases}\right ) + C \left (\begin{cases} \frac{x \sin ^{2}{\left (c + d x \right )}}{2} + \frac{x \cos ^{2}{\left (c + d x \right )}}{2} + \frac{\sin{\left (c + d x \right )} \cos{\left (c + d x \right )}}{2 d} & \text{for}\: d \neq 0 \\x \cos ^{2}{\left (c \right )} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(B*cos(d*x+c)+C*cos(d*x+c)**2,x)

[Out]

B*Piecewise((sin(c + d*x)/d, Ne(d, 0)), (x*cos(c), True)) + C*Piecewise((x*sin(c + d*x)**2/2 + x*cos(c + d*x)*
*2/2 + sin(c + d*x)*cos(c + d*x)/(2*d), Ne(d, 0)), (x*cos(c)**2, True))

________________________________________________________________________________________

Giac [A]  time = 1.24177, size = 43, normalized size = 1.13 \begin{align*} \frac{1}{4} \, C{\left (2 \, x + \frac{\sin \left (2 \, d x + 2 \, c\right )}{d}\right )} + \frac{B \sin \left (d x + c\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(B*cos(d*x+c)+C*cos(d*x+c)^2,x, algorithm="giac")

[Out]

1/4*C*(2*x + sin(2*d*x + 2*c)/d) + B*sin(d*x + c)/d